<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition>
	<h:panelGrid columns="2" style="width:100%">
		<h:panelGrid id="locatonInfoInputPanel" columns="2"
			rendered="#{locationModel.current != null}"  style="width:100%">
			<h:outputText value="id" />
			<h:outputText value="#{locationModel.current.id}" />
			<h:outputText value="Name" />
			<h:inputText value="#{locationModel.current.name}" />
			<h:outputText value="Number" />
			<h:inputText value="#{locationModel.current.number}" />
			<h:outputText value="District" />
			<h:inputText value="#{locationModel.current.district}" />
			<h:outputText value="Address" />
			<h:inputText value="#{locationModel.current.address}"  style="width:300px"/>
			<h:outputText value="Post Code" />
			<h:inputText value="#{locationModel.current.postCode}" />
			<h:outputText value="Latitude" />
			<h:inputText value="#{locationModel.current.latitude}" />
			<h:outputText value="Longitude" />
			<h:inputText value="#{locationModel.current.longitude}" />
			<h:outputText value="Contact Person" />
			<h:inputText value="#{locationModel.current.contactPerson}" />
			<h:outputText value="Telephone" />
			<p:inputMask mask="(999)999-9999"
				value="#{locationModel.current.telephone}" />
			<h:outputText value="Mobile phone" />
			<p:inputMask mask="(999)999-9999"
				value="#{locationModel.current.mobilePhone}" />
			<h:outputText value="eMail" />
			<h:inputText value="#{locationModel.current.email}" />
			<h:outputText value="Type" />
			<p:selectOneMenu value="#{locationModel.current.type}">
				<f:selectItems value="#{locationModel.availableTypes}" var="type"
					itemLabel="#{type.label}" itemValue="#{type}"></f:selectItems>
			</p:selectOneMenu>
			<h:outputText value="Description" />
			<p:inputTextarea value="#{locationModel.current.description}" />
			<h:outputText value="Is prepaid location?" />
			<p:selectBooleanCheckbox value="#{locationModel.current.isPrepaid}"
				itemLabel="It is a prepaid location?" />
			<h:outputText value="Is Home delivery available?" />
			<p:selectBooleanCheckbox
				value="#{locationModel.current.isHomeDeliveryAvailable}"
				itemLabel="Is Home delivery available?" />
			<h:outputText value="Is Fridge available?" />
			<p:selectBooleanCheckbox
				value="#{locationModel.current.isFridgeAvailable}"
				itemLabel="Is Fridge available?" />
			<h:outputText value="Is Canceled?" />
			<p:selectBooleanCheckbox
				value="#{locationModel.current.isCanceled}"
				itemLabel="Is canceled?" />
		</h:panelGrid>

		<p:dataTable var="day" value="#{locationModel.current.pickupSchedules}"  style="width:100%">
			<p:column>
				<h:outputText value="#{day.id}" />
			</p:column>
			<p:column>
				<p:selectBooleanCheckbox value="#{day.isAvailable}" ></p:selectBooleanCheckbox>
			</p:column>
			<p:column>
				<h:outputText value="#{day.dayOfWeek.label}" />
			</p:column>
			<p:column>
				<h:panelGrid columns="2">
					<p:spinner value="#{day.beginHour}" min="7" max="23" size="1"
						suffix="h"></p:spinner>
					<p:spinner value="#{day.beginMinute}" min="0" max="59" size="1"
						suffix="m" stepFactor="10"></p:spinner>
				</h:panelGrid>
			</p:column>
			<p:column>
				<h:outputText value="--To--" />
			</p:column>
			<p:column>
				<h:panelGrid columns="2">
					<p:spinner value="#{day.endHour}" min="7" max="23" size="1"
						suffix="h"></p:spinner>
					<p:spinner value="#{day.endMinute}" min="0" max="59" size="1"
						suffix="m" stepFactor="10"></p:spinner>
				</h:panelGrid>
			</p:column>
		</p:dataTable>

		<ui:remove>
			<p:dataGrid var="day" value="#{locationModel.currentPickupSchedules}"
				columns="1" rows="7">
				<p:column>
					<p:panel>
						<h:panelGrid columns="6">
							<h:outputText value="#{day.id}" />
							<p:selectBooleanCheckbox value="#{day.selected}"
								itemLabel="#{day.dayOfWeek.label}" style="width:100px" />
							<h:panelGrid columns="2">
								<p:spinner value="#{day.beginHour}" min="7" max="23" size="1"
									suffix="h"></p:spinner>
								<p:spinner value="#{day.beginMinute}" min="0" max="59" size="1"
									suffix="m" stepFactor="10"></p:spinner>
							</h:panelGrid>
							<h:outputText value="--To--" />
							<h:panelGrid columns="2">
								<p:spinner value="#{day.endHour}" min="7" max="23" size="1"
									suffix="h"></p:spinner>
								<p:spinner value="#{day.endMinute}" min="0" max="59" size="1"
									suffix="m" stepFactor="10"></p:spinner>
							</h:panelGrid>

						</h:panelGrid>
					</p:panel>
				</p:column>
			</p:dataGrid>
		</ui:remove>
	</h:panelGrid>
</ui:composition>

</html>